package com.endurance.service.impl;

import com.endurance.dao.TestBDao;
import com.endurance.pojo.Transfer;
import com.endurance.service.TestServiceB;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TestServiceBImpl implements TestServiceB {

    @Autowired
    private TestBDao testBDao;

    @Override
    public void updateB() {
        testBDao.update(new Transfer("王五", +1000.0));
        throw new RuntimeException();
    }

    @Override
    public void reset() {
        testBDao.reset(new Transfer("王五", 2000.0));
        testBDao.reset(new Transfer("赵六", 6000.0));
    }

    @Override
    public void list() {
        for (Transfer transfer : testBDao.list()) {
            System.out.println(transfer);
        }
    }

}
